#pragma once
#include "afxcmn.h"
#include "PanelReference.h"
#include "PanelControl.h"



// CXmlFileView form view

class CXmlFileView : public CFormView , public i_data_listener
{
	DECLARE_DYNCREATE(CXmlFileView)

protected:
	CXmlFileView();           // protected constructor used by dynamic creation
	virtual ~CXmlFileView();

	void ShowTab(int aIndex);

public:
	enum { IDD = IDD_XMLFILEVIEW };
#ifdef _DEBUG
	virtual void AssertValid() const;
#ifndef _WIN32_WCE
	virtual void Dump(CDumpContext& dc) const;
#endif
#endif

	CPanelReference	m_panReference;
	CPanelControl	m_panControl;

	CMFCTabCtrl		m_newTab;
protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	CTabCtrl m_Tab;
	afx_msg void OnTcnSelchangeTabXml(NMHDR *pNMHDR, LRESULT *pResult);


	//data_listener
	virtual void on_set_data(i_data* aData);
	wchar_t* get_listener_name(){return L"xml_view";}
	void on_event(s_data_event& e);
protected:
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
public:
	afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
	virtual BOOL PreTranslateMessage(MSG* pMsg);
};


